<template>
    <div class="sshy">

        <div>
            <el-divider content-position="left">所属行业</el-divider>
         <span v-for="item in sshyPrecentVo">
            <el-tag @click="getListData(itme,1)">{{item.sshy}}-{{item.num}}-{{item.precent|numFilter}}%</el-tag>
        </span>
        </div>

        <div>
            <el-divider content-position="left">所属概念</el-divider>
         <span v-for="item in ssGnPrecentVo">
            <el-tag @click="getListData(itme,1)">{{item.sshy}}-{{item.num}}-{{item.precent|numFilter}}%</el-tag>
        </span>
        </div>

    </div>
</template>

<script>
    import Axios from 'axios';
    export default {
        name: 'Sshy',
        props: {
            msg: String
        },
        created(){
            //发送请求
            this.sshy()
            this.ssgn()
        },
        data() {
            return {
                getRowKeys(row) {
                    return row.index;
                },
                zjList: null,
                expands: [],
                sshyPrecentVo:null,
                ssGnPrecentVo:null
            }

        },
        filters: {
            numFilter(value) {
                // 截取当前数据到小数点后两位
                value= value*100;

                let tempVal = parseFloat(value).toFixed(3);
                let realVal = tempVal.substring(0, tempVal.length - 1);
                return realVal;
            },
        },
        methods:{
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
            sshy(){//网络请求数据
                //所属行业占比
                var purl=this.Global.httpUrl+"/shares/getSshyPrecent"
                Axios.get(purl).then((res)=>{
                    this.sshyPrecentVo=res.data.data;
                    console.log(res.data);
                }).catch((error)=>{
                    console.log(error);
                })
            },
            ssgn(){//网络请求数据
                //所属行业占比
                var purl=this.Global.httpUrl+"/shares/getSsGnPrecent"
                Axios.get(purl).then((res)=>{
                    this.ssGnPrecentVo=res.data.data;
                    console.log(res.data);
                }).catch((error)=>{
                    console.log(error);
                })
            },
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

    .el-menu-vertical-demo:not(.el-menu--collapse) {
        width: 100px;
        min-height: 400px;
    }

</style>
